---
layout: page
---

<div class="home">

<!-- cycles through posts to get tags -->
{% assign rawtags = "" %}
{% for post in site.posts %}
{% assign post_tags = post.tags | join:'|' | append:'|' %}
{% assign rawtags = rawtags | append:post_tags %}
{% endfor %}

<!-- cycles through portfolio collection to get tags -->
{% assign portfolio =  site.portfolio | map: 'tags' | join: ','  | split: ',' | uniq %}
{% for tag in portfolio %}
{% assign portfolio_tags = tag | join:'|' | append:'|' %}
{% assign rawtags = rawtags | append:portfolio_tags %}
{% endfor %}

<!-- cycles through pages to get tags -->
{% for page in site.pages %}
{% assign page_tags = page.tags | join:'|'  %}
{% assign rawtags = rawtags | append:page_tags %}
{% endfor %}    
    
<!-- Displays the list of tags-->
{% include tags_list.html tags=rawtags %}

    <!-- Displays the posts and pages that contains the tag-->
    <div class="posts">
        {% for tag in tags %}
        <h3 id="{{ tag | cgi_escape }}" class="tag-anchor">
            <a href="#{{ tag | cgi_escape }}"><i class="fa fa-tag fa-fw"></i> {{ tag }}</a>
            <a href="#{{ page.title }}" style="float: right"><i class="fa fa-chevron-up" aria-hidden="true"> </i> </a>

        </h3>

        <!-- Posts and collection for each tags -->
        <div class="tag-posts">

            <!-- Pages -->
            {% for page in site.pages %} 
                {% if page.tags contains tag %}
                <h5 class="tag-title">
                    <a href="{{ page.url | prepend: site.baseurl }}">
                        <i class="fa fa-file-image-o" aria-hidden="true"></i>
                        {{ page.title }}
                    </a>
                    
                    <div class="meta">
                        {{ "today" | date: "%B %-d, %Y" }}
                    </div>
                </h5>
                {% endif %} 
            {% endfor %} 
            
            <!-- Posts -->
            {% for post in site.posts %} 
                {% if post.tags contains tag %}
                <h5 class="tag-title">
                    <a href="{{ post.url | prepend: site.baseurl }}">
                        <i class="fa fa-file-text-o" aria-hidden="true"></i>
                        {{ post.title }}
                    </a>
                    
                    <div class="meta">
                        {{ post.date | date: "%B %-d, %Y" }}
                    </div>
                </h5>
                {% endif %} 
            {% endfor %} 
            
            <!-- Portfolio -->
            {% for note in site.portfolio %} 
                {% if note.tags contains tag %}
                <h5 class="tag-title">
                    <a href="{{ site.baseurl }}{{ note.url }}">
                        <i class="fa fa-file-o" aria-hidden="true"></i>
                        {{ note.title }}
                    </a>
                
                    <div class="meta">
                        {{ note.date | date: "%B %-d, %Y" }}
                    </div>
                </h5>
                {% endif %} 
            {% endfor %}

        </div>
        {% endfor %}

    </div>
</div>
